#include <iostream>
#include <iomanip>

using namespace std;


long double fat(long long r) {
       long double fat = 1;
       for (long long k = 1; k <= r; k++) {
           fat *= k;
       }
       return fat;
   }


long double minimize(long n, long r) {
       long double numerator = 1;
       long long one_denominator ;
       long long other_denominator;
       if (n - r > r) {
            one_denominator = n - r;
            other_denominator = r;
       } else {
           one_denominator = r;
           other_denominator = n - r;
       }
       for (long k = one_denominator; k <= n; k++) {
           numerator *= k;
       }
       return numerator / (one_denominator * (fat(other_denominator)));
   }


       void process(long long n, long long r) {
	long long a1 = n;
	long long a2 = r;
	       if (r < n - r && n - r > 0) {
           r = n - r;
       }
       double result = minimize(n, r);
       cout <<  a1 << " things taken " << a2 << " at a time is " <<  (long long)result << " exactly." << endl;

   }


int main() {
       long long x, y;
       while (true) {
               cin >> x >> y;
               if (x == 0 && y == 0) {
               break;
           }
           process(x, y);
       }

}
